package com.example.demo.cloud.customer.rest;

import com.example.demo.client.client.HelloClient;
import com.example.demo.common.vo.ResponseVo;
import com.example.demo.common.vo.ResultVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author root
 * @date 2021-01-08 10:53
 */
@RestController
@RequiredArgsConstructor(onConstructor = @_(@Autowired))
public class HelTest {

    private final HelloClient helloClient;

    @GetMapping("list")
    public ResponseVo<String> list(@RequestParam Integer code) {
        ResponseVo<String> data = helloClient.getList(code);
        return helloClient.getList(code);
    }

    @GetMapping("list1")
    public ResultVo list1(@RequestParam Integer code) {
        String list1 = helloClient.getList1(code);

        return ResultVo.success(helloClient.getList1(code));
    }
}
